package c.a.a.z.c;

import android.graphics.Path;
import android.graphics.PointF;
import c.a.a.e0.c;
import c.a.a.e0.f;
import c.a.a.f0.a;
import java.util.List;

/* compiled from: ShapeKeyframeAnimation */
public class l extends a<c.a.a.b0.k.l, Path> {
    public final c.a.a.b0.k.l i = new c.a.a.b0.k.l();
    public final Path j = new Path();

    public l(List<a<c.a.a.b0.k.l>> list) {
        super(list);
    }

    public Object f(a aVar, float f) {
        c.a.a.b0.k.l lVar = (c.a.a.b0.k.l) aVar.b;
        c.a.a.b0.k.l lVar2 = (c.a.a.b0.k.l) aVar.c;
        c.a.a.b0.k.l lVar3 = this.i;
        if (lVar3.b == null) {
            lVar3.b = new PointF();
        }
        boolean z = lVar.c || lVar2.c;
        lVar3.c = z;
        if (lVar.a.size() != lVar2.a.size()) {
            StringBuilder g = c.b.a.a.a.g("Curves must have the same number of control points. Shape 1: ");
            g.append(lVar.a.size());
            g.append("\tShape 2: ");
            g.append(lVar2.a.size());
            c.b(g.toString());
        }
        int min = Math.min(lVar.a.size(), lVar2.a.size());
        int size;
        if (lVar3.a.size() < min) {
            for (size = lVar3.a.size(); size < min; size++) {
                lVar3.a.add(new c.a.a.b0.a());
            }
        } else if (lVar3.a.size() > min) {
            for (size = lVar3.a.size() - 1; size >= min; size--) {
                List list = lVar3.a;
                list.remove(list.size() - 1);
            }
        }
        PointF pointF = lVar.b;
        PointF pointF2 = lVar2.b;
        float e = f.e(pointF.x, pointF2.x, f);
        float e2 = f.e(pointF.y, pointF2.y, f);
        if (lVar3.b == null) {
            lVar3.b = new PointF();
        }
        lVar3.b.set(e, e2);
        for (min = lVar3.a.size() - 1; min >= 0; min--) {
            c.a.a.b0.a aVar2 = (c.a.a.b0.a) lVar.a.get(min);
            c.a.a.b0.a aVar3 = (c.a.a.b0.a) lVar2.a.get(min);
            PointF pointF3 = aVar2.a;
            PointF pointF4 = aVar2.b;
            pointF2 = aVar2.c;
            PointF pointF5 = aVar3.a;
            PointF pointF6 = aVar3.b;
            PointF pointF7 = aVar3.c;
            ((c.a.a.b0.a) lVar3.a.get(min)).a.set(f.e(pointF3.x, pointF5.x, f), f.e(pointF3.y, pointF5.y, f));
            ((c.a.a.b0.a) lVar3.a.get(min)).b.set(f.e(pointF4.x, pointF6.x, f), f.e(pointF4.y, pointF6.y, f));
            ((c.a.a.b0.a) lVar3.a.get(min)).c.set(f.e(pointF2.x, pointF7.x, f), f.e(pointF2.y, pointF7.y, f));
        }
        lVar2 = this.i;
        Path path = this.j;
        path.reset();
        PointF pointF8 = lVar2.b;
        path.moveTo(pointF8.x, pointF8.y);
        f.a.set(pointF8.x, pointF8.y);
        for (int i = 0; i < lVar2.a.size(); i++) {
            c.a.a.b0.a aVar4 = (c.a.a.b0.a) lVar2.a.get(i);
            PointF pointF9 = aVar4.a;
            pointF = aVar4.b;
            pointF8 = aVar4.c;
            if (pointF9.equals(f.a) && pointF.equals(pointF8)) {
                path.lineTo(pointF8.x, pointF8.y);
            } else {
                path.cubicTo(pointF9.x, pointF9.y, pointF.x, pointF.y, pointF8.x, pointF8.y);
            }
            f.a.set(pointF8.x, pointF8.y);
        }
        if (lVar2.c) {
            path.close();
        }
        return this.j;
    }
}
